package model;

import java.util.ArrayList;

/**
 * This Class is a Taarif Request Model which Saves Taarif requests in ArrayList which contains object of Taarif class.
 * @author Tal
 *
 */
public class TaarifRequestModel 
{
	ArrayList<TaarifModel>  taarifReq=null;
	
	/**
	 * This is TaarifRequestModel constructor.
	 * @param taarifReq.
	 */
	public TaarifRequestModel()
	{
		if (taarifReq==null)
		this.taarifReq=new ArrayList<TaarifModel>();
	}
	
	/**
	 * This method returns ArrayList of <Taarif>.
	 * @return ArrayList taarifReq.
	 */
	public ArrayList<TaarifModel> getTaarifRequest()
	{
		return this.taarifReq;
	}
	

	/**
	 * This method remove  Taarif by Id.
	 *
	 */
	
	public  void RemoveTaarif(ArrayList<String> subGroup)
	{
		int i=0;
		int size=taarifReq.size();
		
		
		for(int j=0;j<subGroup.size();j++)
		{
			i=0;
			while(i<size)
			{
				
			  if(taarifReq.get(i).getserviceID()==Integer.parseInt(subGroup.get(j)))
			  {
				taarifReq.remove(i);
				size=taarifReq.size();
			  }
			  else
				  i++;
			}
			
	
		}
			
	}
	
	/**
	 * This method remove all of Taarif.
	 *
	 */
	
	public  void RemoveTaarifRequest()
	{
		this.taarifReq.removeAll(getTaarifRequest());
	}
}
